Skip to content

Audit fixes: services after reload, diagnostics redaction, climatisation (0.4.2) - #10

Merged
bartolije merged 1 commit into
mainfrom
fix/audit-2026-11
Nov 6, 2026
Merged

bartolije merged 1 commit into
mainfrom
fix/audit-2026-11

Conversation

@bartolije

Copy link
Copy Markdown
Owner

Fixes from the November 2026 audit, released as 0.4.2. Requires pyporscheconnectapi-bartolije 0.5.1 (bartolije/pyporscheconnectapi#8).

Must fix

  • climatisation_start / climatisation_stop disappeared after any reload of the entry (reauth and reconfigure reload it) until Home Assistant restarted. They stay registered now.
  • Diagnostics leaked the exact position (GPS_LOCATION.location is a "lat,lon" string), the pairing code and key data. Those values are redacted as a whole.
  • Climatisation is read from HVAC_SUMMARY (lib 0.5.1): CLIMATIZER_STATE no longer reports it, so the climate entity, switch and services were never available.

Should fix

  • The config flow gives the library its own HTTP client (no zstd, no blocking SSL setup in the event loop), reused from the login step to the captcha step.
  • Errors that are not about the credentials show "cannot_connect" instead of "invalid_auth".
  • The device tracker is added on a later refresh when the car was in privacy mode at startup.
  • Dead code removed (unreachable error handling, STARTUP_MESSAGE and its constants, unused aliases and attributes).

Nice to have: the captcha is no longer logged; the climatise switch is disabled by default (the climate entity sends the same command); empty picture locations are fetched again once a day, not on every refresh.

Tests: 76 pass on HA 2026.11.0 with lib 0.5.1 from PyPI. The 7 new tests fail on the previous code. Not tested on a car with remote climatisation.

🤖 Generated with Claude Code

Must fix
- Services climatisation_start/stop disappeared after any reload of the
  last entry (reauth and reconfigure reload it) until Home Assistant was
  restarted: they are registered once in async_setup and no longer
  removed on unload.
- Diagnostics leaked the exact position (GPS_LOCATION.location is a
  "lat,lon" string), the pairing code and key data (BLEID_DDADATA...):
  those values are now redacted as a whole.
- Climatisation is read from HVAC_SUMMARY through
  pyporscheconnectapi-bartolije 0.5.1 (CLIMATIZER_STATE no longer reports
  it); the climatisation_start zones come from the same measurement.

Should fix
- The config flow passes its own HTTP client (no zstd, no blocking SSL
  setup in the event loop) to the library, reused from the login step to
  the captcha step.
- Errors that are not about the credentials show "cannot_connect" instead
  of "invalid_auth".
- The device tracker is added on a later refresh when the car was in
  privacy mode at startup.
- Removed dead code: unreachable error handling after the first refresh,
  STARTUP_MESSAGE and its constants, the get_vechicle_data_leaf alias,
  async_reload_entry, CaptchaRequired, _reauth_entry and the lock's unused
  door_lock_state_available.

Nice to have
- The captcha is no longer written to the log.
- The climatise switch is disabled by default: the climate entity sends
  the same command.
- Empty picture locations are fetched again once a day instead of on
  every refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bartolije
bartolije merged commit da1089b into main Nov 6, 2026
8 checks passed
bartolije pushed a commit that referenced this pull request Nov 6, 2026
The audit fixes merged in #10 ship as 0.5.0 rather than 0.4.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bartolije
bartolije deleted the fix/audit-2026-11 branch November 12, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant